package com.exampl.springstack.common.exceptionUtils.exception;

import com.exampl.springstack.common.exceptionUtils.enums.ResultEnum;

/**
 * @author Qiangfanghao
 * 系统自定义异常
 */
public class SystemException extends RuntimeException {
    /**
     * 自定义异常的状态码
     */
    private int code;

    /**
     * http 状态码
     */
    private int httpStatus;

    public SystemException(ResultEnum em){
        super(em.getMessage());
        this.code = em.getCode();
        this.httpStatus=em.getHttpStatus();
    }

    public int getCode() {
        return code;
    }

    public int getHttpStatus() {
        return httpStatus;
    }
}
